#! /usr/bin/env python

import mathex

def comp(p):
    sn=0
    for a in range(p/3,p/2+1):
        for b in range(p/3,a+1):
            c = p-a-b
            if c>0 and a+b>c and a+c>b and b+c>a and b*b+c*c==a*a:
                sn += 1
    return sn
    
def main():
    maxsn = 0
    maxp=0
    for p in range(3,1000):
        print p
        sn = comp(p)
        if sn>maxsn:maxp=p
        maxsn = max(sn,maxsn)

    print maxsn
    print maxp
if __name__ == '__main__':
    main()
    
